﻿<%@ Assembly Name="zevenseas.TimerJobOverview, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4306074270f0265a"%> 
<%@ Page Language="C#" Inherits="zevenseas.TimerJobOverview.ApplicationPages.Overview" MasterPageFile="~/_admin/admin.master"%> 

<%@ Register Tagprefix="zs" Namespace="zevenseas.TimerJobOverview.ApplicationPages" Assembly="zevenseas.TimerJobOverview, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4306074270f0265a" %> 
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
<%@ Register Tagprefix="AdminControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint.ApplicationPages.Administration" %>

<%@ Register Tagprefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
<%@ Register TagPrefix="wssuc" TagName="ToolBar" src="~/_controltemplates/ToolBar.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ToolBarButton" src="~/_controltemplates/ToolBarButton.ascx" %>

<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %> 

<asp:Content ID="Content1" contentplaceholderid="PlaceHolderPageTitle" runat="server">
	<SharePoint:EncodedLiteral ID="EncodedLiteral1" runat="server" text="<%$Resources:spadmin, ServiceRunningJobs_PageTitle%>" EncodeMethod='HtmlEncode'/>
</asp:content>
<asp:Content ID="Content2" contentplaceholderid="PlaceHolderPageTitleInTitleArea" runat="server">
	<SharePoint:EncodedLiteral ID="EncodedLiteral2" runat="server" text="<%$Resources:spadmin, ServiceRunningJobs_PageTitle%>" EncodeMethod='HtmlEncode'/>
</asp:Content>
<asp:content ID="Content3" contentplaceholderid="PlaceHolderAdditionalPageHead" runat="server">
<script type="text/javascript">
    function Visascii(ch) {
        return (!(ch.charCodeAt(0) & 0x80));
    }
    function Visspace(ch) {
        return (ch.charCodeAt(0) == 32) || ((9 <= ch.charCodeAt(0)) && (ch.charCodeAt(0) <= 13));
    }
    function stripWS(str) {
        var b = 0;
        var e = str.length;
        while (str.charAt(b) && (Visascii(str.charAt(b)) && Visspace(str.charAt(b))))
            b++;
        while ((b < e) && (Visascii(str.charAt(e - 1)) && Visspace(str.charAt(e - 1))))
            e--;
        return ((b >= e) ? "" : str.substring(b, e));
    }
    var L_NoFieldEmpty_TEXT = "<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,common_nofieldempty_TEXT%>' EncodeMethod='EcmaScriptStringLiteralEncode'/>";
    function CheckForEmptyField(text_orig, field_name) {
        var text = stripWS(text_orig);
        if (text.length == 0) {
            alert(StBuildParam(L_NoFieldEmpty_TEXT, field_name));
            return false;
        }
        return (true);
    }
    function CheckForEmptyFieldNoAlert(text_orig) {
        var text = stripWS(text_orig);
        if (text.length == 0) {
            return false;
        }
        return (true);
    }
    var L_WrongEmailName_TEXT = "<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,common_wrongemailname_TEXT%>' EncodeMethod='EcmaScriptStringLiteralEncode'/>";
    function CheckForAtSighInEmailName(text_orig, field_name) {
        var text = stripWS(text_orig);
        if (!CheckForEmptyField(text_orig, field_name)) return false;
        var indexAt = 0;
        var countAt = 0;
        var countSpace = 0;
        var len = text.length;
        while (len--) {
            if (text.charAt(len) == '@') {
                indexAt = len;
                countAt++;
            }
            if (text.charAt(len) == ' ')
                countSpace++;
        }
        if ((countAt == 0) ||
		(indexAt == 0) ||
		(indexAt == (text.length - 1))
		) {
            alert(StBuildParam(L_WrongEmailName_TEXT, field_name));
            return false;
        }
        if (countSpace != 0) {
            alert(L_TextWithoutSpaces1_TEXT + field_name);
            return false;
        }
        return (true);
    }
    var checkBoxGroupName = "siteCheckboxes";
    function checkBoxClick() {
        var checkBoxHidden = (document.getElementById("<%= HiddenSiteSelections.ClientID %>"));
        checkBoxHidden.value = "";
        var selectAllCheckBox = document.getElementById("selectAllCheckBox");
        if (selectAllCheckBox != null)
            selectAllCheckBox.checked = false;
        var i;
        for (i = 0; i < theForm.length; i++) {
            curGroup = theForm[i].group;
            if (checkBoxGroupName == curGroup && theForm[i].checked == true) {
                checkBoxHidden.value += theForm[i].name + "#";
            }
        }


    }
    function selectAllCheckBoxClick(selectAllCheckBox) {
        var newCheckBoxState = selectAllCheckBox.checked;
        for (i = 0; i < theForm.length; i++) {
            curGroup = theForm[i].group;
            if (checkBoxGroupName == curGroup)
                theForm[i].checked = newCheckBoxState;
        }
        checkBoxClick();
        selectAllCheckBox.checked = newCheckBoxState;
    }
    function _spBodyOnLoad() {
        var checkBoxHidden = (document.getElementById("<%= HiddenSiteSelections.ClientID %>"));
        checkBoxHidden.value = "";
    }


</script>


	<SharePoint:HtcMenuClientFiles ID="HtcMenuClientFiles1" runat="server"/>
	<script language="javascript">
		function NavigateToView(viewId)
		{
			var url = window.location.href + "";
			url = StURLSetVar2(url, "View", viewId);
			STSNavigate(url);
		}
	</script>
</asp:content>
<asp:content ID="Content4" contentplaceholderid="PlaceHolderMain" runat="server">
<input type="hidden" id="HiddenSiteSelections" runat="server" />
	<table width="100%" class="propertysheet" cellspacing="0" cellpadding="0" border="0"> <tr> <td class="ms-descriptionText"> <asp:Label ID="LabelMessage" Runat="server" EnableViewState="False" class="ms-descriptionText"/> </td> </tr> <tr> <td class="ms-error"><asp:Label ID="LabelErrorMessage" Runat="server" EnableViewState="False" /></td> </tr> <tr> <td class="ms-descriptionText"> <asp:ValidationSummary ID="ValSummary" HeaderText="<%$SPHtmlEncodedResources:spadmin, ValidationSummaryHeaderText%>" DisplayMode="BulletList" ShowSummary="True" runat="server"> </asp:ValidationSummary> </td> </tr> <tr> <td><img src="/_layouts/images/blank.gif" width="10" height="1" alt="" /></td> </tr> </table>
	<wssuc:ToolBar runat="server" id="ToolBar" CssClass="ms-toolbar">
	    <template_buttons>
	        <wssuc:ToolBarButton runat="server"
				id="Disable"
				Text="Disable"
				ToolTip=""
				OnClick="DisableLink"
				ImageUrl="/_layouts/images/newitem.gif"
				Padding="2px"
				AccessKey="D" />
			<wssuc:ToolBarButton runat="server"
				id="Delete"
				Text="Delete"
				ToolTip=""
				OnClick="DeleteLink"
				ImageUrl="/_layouts/images/newitem.gif"
				Padding="2px"
				AccessKey="E" />
			<wssuc:ToolBarButton runat="server"
				id="RunNow"
				Text="Run Now"
				ToolTip=""
				OnClick="RunNowLink"
				ImageUrl="/_layouts/images/newitem.gif"
				Padding="2px"
				AccessKey="R"
				Visible="true" />
			<wssuc:ToolBarButton runat="server"
				id="Edit"
				Text="Edit Job"
				ToolTip=""
				OnClick="EditLink"
				ImageUrl="/_layouts/images/newitem.gif"
				Padding="2px"
				AccessKey="E" />
	    </template_buttons>
		<Template_RightButtons>
			<SharePoint:WebApplicationSelector id="webApplicationSelector" runat="server"
				TypeLabelCssClass="ms-listheaderlabel" />
			<AdminControls:ServiceSelector id="serviceSelector" runat="server"
				TypeLabelCssClass="ms-listheaderlabel" />
				<asp:PlaceHolder runat="server">
			 <table border=0 cellpadding=0 cellspacing=0 style='margin-right: 4px'>
			  <tr>
			   <td>&nbsp;</td>
			   <td nowrap class="ms-listheaderlabel"><SharePoint:EncodedLiteral ID="EncodedLiteral3" runat="server" text="<%$Resources:wss,view_selector_view%>" EncodeMethod="HtmlEncode"/></td>
			   <td>&nbsp;</td>
			   <td nowrap class="ms-viewselector">
				<SharePoint:Menu id="MenuViewSelector" runat="server"
					TemplateId = "MenuTemplateView"
					MenuFormat="ArrowAlwaysVisible"
					HoverCellActiveCssClass = "ms-viewselectorhover"
					HoverCellInActiveCssClass = "ms-viewselector"
					ArrowImageUrl="/_layouts/images/blank.gif"
					/>
				<SharePoint:MenuTemplate id="MenuTemplateView" runat="server">
					<SharePoint:MenuItemTemplate id="MenuItemAll" runat="server"
						Text="<%$Resources:spadmin, ServiceRunningJobs_All%>"
						ClientOnClickScript="return NavigateToView('0');"
						MenuGroupId="100"
						Sequence="100"
						/>
					<SharePoint:MenuItemTemplate id="MenuItemService" runat="server"
						Text="<%$Resources:spadmin, Service%>"
						ClientOnClickScript="return NavigateToView('1');"
						MenuGroupId="100"
						Sequence="200"
						/>
					<SharePoint:MenuItemTemplate id="MenuItemWebApplication" runat="server"
						Text="<%$Resources:spadmin, ServiceJobDefinitions_WebApplicationColumn%>"
						ClientOnClickScript="return NavigateToView('2');"
						MenuGroupId="100"
						Sequence="300"
						/>
				</SharePoint:MenuTemplate>
			   </td>
			  </tr>
			  </table>
			</asp:PlaceHolder>		
		</Template_RightButtons>
	</wssuc:ToolBar>
	
	<SharePoint:SPGridView
		id="gridViewDefinitions"
		runat="server"
		AutoGenerateColumns="false"		
		width="100%"
		AllowSorting="True">
	  <AlternatingRowStyle CssClass="ms-alternating" />
	  <Columns>
		    <asp:BoundField DataField="JobGuid" DataFormatString='<input type="checkbox" group="siteCheckboxes" name="{0}" onclick="checkBoxClick();">' HtmlEncode="false" HeaderText=" " ItemStyle-Width="1"/>
		    <SharePoint:SPBoundField DataField="JobTitle" HeaderText="JobTitle" HeaderStyle-Font-Bold="true" />
		    <SharePoint:SPBoundField DataField="LastRunTime" HeaderText="LastRunTime" HeaderStyle-Font-Bold="true" />			    
		    <SharePoint:SPBoundField DataField="Schedule" HeaderText="Schedule" HeaderStyle-Font-Bold="true" />		
		    <SharePoint:SPBoundField DataField="IsDisabled" HeaderText="IsDisabled" HeaderStyle-Font-Bold="true" />		    
		    <zs:SPBoundHTMLField DataField="Status" HeaderText="Status" HeaderStyle-Font-Bold="true" />
		    <SharePoint:SPBoundField DataField="Parent" HeaderText="Service" HeaderStyle-Font-Bold="true" />
	  </Columns>
	</SharePoint:SPGridView>
	
	
	<%--<SharePoint:SPGridView
	    Visible="false"
		id="gridViewRunning"
		runat="server"
		AutoGenerateColumns="false"
		width="100%"
		AllowSorting="True"
		>
	  <AlternatingRowStyle CssClass="ms-alternating" />
	  <Columns>		    
		    <SharePoint:SPBoundField DataField="JobTitle" HeaderText="JobTitle" HeaderStyle-Font-Bold="true" />
		    <SharePoint:SPBoundField DataField="StartTime" HeaderText="Process" HeaderStyle-Font-Bold="true" />			    
		    <SharePoint:SPBoundField DataField="Process" HeaderText="Schedule" HeaderStyle-Font-Bold="true" />				   
		    <zs:SPBoundHTMLField DataField="Status" HeaderText="Status" HeaderStyle-Font-Bold="true" />		
	  </Columns>
	</SharePoint:SPGridView>--%>	
 </asp:content>
